﻿using System;
using System.Collections.Generic;
using System.Text;
using BlueFinity.mvNET.CoreObjects;
using mvLibrary.Helpers.Utils;

namespace mvLibrary.Helpers.Exceptions
{
    public class PermissionsException : BusinessException
    {
        private const string NO_ITEMS_SELECTED = "NO_ITEMS_SELECTED";

        public PermissionsException(string message)
            : base(message)
        {

        }

        public PermissionsException(mvException ex)
        {
            this.ErrorMessage = ex.Code.ToString().Equals(NO_ITEMS_SELECTED) ? 
                MessageUtils.UsuarioSinPermisos : MessageUtils.SeProdujoUnErrorEnLaCargaDePermisos(ex.Message);
        }
    }
}
